﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPF入门1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("hello world");
            MessageBox.Show(btn1.Name);
        }

        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            this.Title = Grid1.Name;

            Context._window = this;

        }

        private void Btn3_OnClick(object sender, RoutedEventArgs e)
        {
            this.Close();
            
        }

        private void Btn2_OnClick(object sender, RoutedEventArgs e)
        {
            // Page1 page1 = new Page1();
            // page1.Visibility = Visibility.Visible;
            Window2 window2 = new Window2();
            window2.Show();
        }
    }
}
